//
//  KNImage.h
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface KNImage : NSObject


#pragma mark - 拉伸
/**
 *  图片拉伸
 *
 *  @param imageName name
 *  @param insets  位置 ( UIEdgeInsetsZero or UIEdgeInsetsMake(10, 10, 10, 10) )
 *  @param resizingMode  方式 (UIImageResizingModeTile)
 *
 *  @return image
 */
+ (UIImage *)pullImageWithName:(NSString *)imageName insets:(UIEdgeInsets)insets resizingMode:(UIImageResizingMode)resizingMode;



#pragma mark - 颜色生成图片
/**
 *  颜色生成图片
 *
 *  @param color 颜色
 *  @param size  大小
 *
 *  @return image
 */
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size;


#pragma mark - 截图
/**
 *  简单的截图
 *
 *  @param aView 需要截图的view
 *  @param aSize 需要截图的尺寸
 *
 *  @return 截图
 */
+ (UIImage *)imageWithView:(UIView *)aView size:(CGSize)aSize;



#pragma mark - 旋转图片
/**
 *  旋转图片
 */
+ (UIImage *)image:(UIImage *)image rotation:(UIImageOrientation)orientation;
+ (UIImage *)rotateWithImgae:(UIImage *)aImgae rotate:(double)aRotate;

/**
 * 转正图片
 */
+ (UIImage *)imageWithRightOrientation:(UIImage *)aImage;

@end
